package com.apes.framework.jpa.config;

import com.apes.framework.jpa.ApesBean;
import com.apes.framework.jpa.generator.ApesGenerator;
import lombok.Getter;
import lombok.Setter;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;
import org.hibernate.annotations.SelectBeforeUpdate;

import javax.persistence.*;

/**
 * 功能：Java源码
 *
 * @author xul
 * @create 2019-02-25 14:12
 */
@Getter
@Setter
@SelectBeforeUpdate
@DynamicInsert
@DynamicUpdate
@Entity
@Table(name = JavaSource.CONST_TABLE_NAME)
public class JavaSource implements ApesBean {
    public static final String CONST_TABLE_NAME = "ir_java_source";

    @Id
    @Column(name = "id", length = 256)
    @ApesGenerator(code = CONST_TABLE_NAME, name = "Java源码")
    private String id;

    @Lob
    @Basic(fetch = FetchType.LAZY)
    @Column(name = "source", columnDefinition = "CLOB")
    private String source;
}
